<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<style>
  input {
    width: 300px;
    height: 30px;
    line-height: 30px;
  }

  button {
    margin-top: 50px;
    background-color: red;
    width: 100px;
    line-height: 30px;
    margin-left: 20px;
  }

  span {
    display: inline-block;
    margin-top: 50px;
  }
</style>

<body>

  <div>
    <input type="text" placeholder="输入html字体大小" class="html">
    <input type="text" placeholder="输入rem" class="rem">

    <button class="btn">多个</button>

    <br>
    <span></span>
  </div>
  <script>
    let html = document.querySelector('.html')



    let rem = document.querySelector('.rem')
    const btn = document.querySelector('.btn')
    const span = document.querySelector('span')
    btn.addEventListener('click', e => {
      const value = parseFloat(rem.value.trim())
      const htmlFont = parseFloat(html.value.trim())
      console.log(value, htmlFont);
      span.innerHTML = value * htmlFont + 'px'

    }, false)
    span.onclick = function () {
      rem.value = this.innerHTML;
      rem.select();
      document.execCommand('copy');
    }

  </script>
</body>

</html>